package com.pinyou.config.controller;

import com.pinyou.config.service.LearnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Title: LogTestController
 * @Description:
 * @Auther:
 * @create 2020/3/19 17:26
 */
@RestController
@RequestMapping("log")
@Slf4j
public class LogTestController {
    @Autowired
    private LearnService learnService;

    @GetMapping("info")
    public void info(){
        log.info("info");
    }
    @GetMapping("warn")
    public void warn(){
        log.warn("warn");
    }
    @GetMapping("error")
    public void error(){
        log.error("error");
    }
    @GetMapping("async")
    public void async(){
        System.out.println(111);
        learnService.sleepTime();
        System.out.println(2222);
    }
    @GetMapping("scheduled")
    public String scheduled(){
       learnService.scheduled();
       return "success";
    }
}
